program WebAPI;
{$STRONGLINKTYPES ON}

uses
  Forms,
  Windows,
  uMain in '..\Unit\uMain.pas' {fmMain},
  uDB in '..\Unit\uDB.pas' {DB: TDataModule},
  ServerController in '..\Controller\Base\ServerController.pas',
  UserController in '..\Controller\UserController.pas' {$R *.res},
  BaseController in '..\Controller\Base\BaseController.pas',
  uUser in '..\Model\uUser.pas';

var
  hMutex: THandle;

begin
  Application.Title := 'WebAPI';
  hMutex := CreateMutex(nil, False, PChar(Application.Title));
  if GetLastError = ERROR_ALREADY_EXISTS then
  begin
    fmMain := TfmMain.Create(nil);
    fmmain.OpenSystem();
    fmmain.Free;
    CloseHandle(hMutex);
    application.Terminate;
  end
  else
  begin
    Application.Initialize;
    Application.MainFormOnTaskbar := True;
    Application.CreateForm(TfmMain, fmMain);
    Application.Run;
  end;
end.

